# @FileName  :  config.py
# @Time      :  2025/7/28 22:59
# @Author    :  Ayanami
# @info      : config.py
from pydantic_settings import BaseSettings
from typing import Optional

class Settings(BaseSettings):
    # JWT 设置
    SECRET_KEY: str = "your-secret-key-here-change-in-production"
    ALGORITHM: str = "HS256"
    ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
    REFRESH_TOKEN_EXPIRE_DAYS: int = 7
    # 应用设置
    APP_NAME: str = "Training Platform"
    DEBUG: bool = True

    # 密码设置
    PWD_CONTEXT_SCHEMES: list[str] = ["bcrypt"]
    PWD_CONTEXT_DEPRECATED: str = "auto"

    class Config:
        env_file = ".env"


settings = Settings()

TORTOISE_ORM = {
    "connections": {
        "default": {
            "engine": "tortoise.backends.mysql",
            "credentials": {
            "host": "172.16.1.8",
            "port": "3306",
            "user": "nina",
            "password": "nina",
            "database": "g_project",
        }
    }
    },
    "apps": {
        "models": {
            "models": ["app.models.models", "aerich.models"],
            "default_connection": "default",
        }
    },
    "timezone": "Asia/Shanghai",
}
